<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>53数组去重若干方法.vep</title>
</head>
<body>

<script>
  let arr = [1,2,3,4,44,42,21,3,3,2,4,5,5,3,2,2]

  function uniqueArr(array) {
    let _arr = [],
      isRepeat;
    for (let i = 0; i < array.length; i++) {
      isRepeat = false;
      for (let j = 0; j < _arr.length; j++) {
        if (_arr[j] === array[i]){
          isRepeat = true
          break;
        }
      }
      if (!isRepeat){
        _arr.push(array[i])
      }
    }

    return _arr.sort((a,b)=>{
      return a-b
    })

  }

  console.log(uniqueArr(arr));

</script>
</body>
</html>